package com.ydgk.dao;

import com.ydgk.bean.Furniture;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface FurnitureMapper {

    int findCountByKid(int kid);
    int findCountByKtid(int ktid);
    int insert(Furniture furniture);
    List<Furniture> findAll(Map<String, Object> factorMap);
    int findAllCount(Map<String, Object> factorMap);
    void setCondition(int fid, int val, Date date);

    @Select("select * from furniture where fid = #{fid}")
    Furniture findById(int fid);

    @Delete("delete from furniture where fid = #{fid}")
    int deleteById(int fid);

    @Update("update furniture set fname = #{fname} , ftag = #{ftag} , fprice = #{fprice} , fface = #{fface} , sales =#{sales}  where fid = #{fid}")
    int updateById(Furniture furniture);

    List<Furniture> findAllByKid(Integer kid);
}
